plugins.js ➔ noop   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 1
rs 10
c 1
b 0
f 0
1
// Avoid `console` errors in browsers that lack a console.
2
(function() {
3
    var method;
4
    var noop = function () {};
5
    var methods = [
6
        'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error',
7
        'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log',
8
        'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd',
9
        'timeline', 'timelineEnd', 'timeStamp', 'trace', 'warn'
10
    ];
11
    var length = methods.length;
12
    var console = (window.console = window.console || {});
13
14
    while (length--) {
15
        method = methods[length];
16
17
        // Only stub undefined methods.
18
        if (!console[method]) {
19
            console[method] = noop;
20
        }
21
    }
22
}());
23
24
// Place any jQuery/helper plugins in here.
25